package com.ziven.learn;

import android.app.Application;

import com.ziven.easygo.EasyGos;
import com.ziven.easygo.overall.IOverall;
import com.ziven.easygo.util.DataProvider;
import com.ziven.learn.dispatch.EasyGoLearn;
import com.ziven.processor.LearnBaseBean;
import com.ziven.processor.LearnCreate;

import java.util.List;

/**
 * @author Ziven
 */
public class LearnApplication extends Application implements LearnCreate, IOverall<LearnModelDispatch> {

    private final LearnModelDispatch learnModelDispatch = new LearnModelDispatch();

    @Override
    public void onCreate() {
        super.onCreate();
        EasyGos.init(this, true);
    }

    @Override
    public List<LearnBaseBean> create() {
        DataProvider<LearnBaseBean> provider = DataProvider.ofEmpty();
        return provider.add(new LearnBaseBean(new EasyGoLearn(), "EasyGoLearn"))
                .getList();
    }

    @Override
    public LearnModelDispatch getDispatch() {
        return learnModelDispatch;
    }
}
